Interactive Session: Exploring Urban Greenhouse Gas Emissions
About the Data
The Greenhouse gas And Air Pollutants Emissions System (GRA²PES) dataset at the GHG Center is an aggregated, regridded, monthly high-resolution (0.036 x 0.036°) data product with emissions of both greenhouse gases and air pollutants developed in a consistent framework. The dataset contains emissions over the contiguous United States covering major anthropogenic sectors, including energy, industrial fuel combustion and processes, commercial and residential combustion, oil and gas production, on-road and off-road transportation, etc. Carbon dioxide (CO₂) emissions are developed along with those of air pollutants including CO, NOₓ, SO₂, and PM2.5 with consistency in spatial and temporal distributions. Emissions by sectors are reported as column totals in units of metric tons per km² per month. Spatial-temporal surrogates are developed to distribute CO₂ emissions to grid cells to keep consistency between greenhouse gases and air quality species. The current version of GRA²PES is for 2021. Long-term emissions and more greenhouse gas species (e.g., methane) are under development and will be added in the future.
Requirements
Set up Python Environment - See setup_instructions.md in the /setup/ folder
Learning Objectives
How to use U.S. GHG Center STAC Catalog to access Greenhouse gas And Air Pollutants Emissions System (GRA²PES) data
How to visualize datasets using folium and perform zonal statistics
How to plot time series for Greenhouse gas And Air Pollutants Emissions System (GRA²PES) and analyze the results for a region of interest
Approach
Identify available dates and temporal frequency of observations for the given collection using the GHGC API /stacendpoint. The collection processed in this notebook is the Wetland Methane Emissions, LPJ-wsl Model data product
Pass the STAC item into the raster API /stac/tilejson.json endpoint
Define the spatial region of interest
Using plugins from folium to visualize two tiles (side-by-side), allowing time point comparison
After the visualization, perform zonal statistics for a given polygon
Plot monthly time series for GRA²PES
Setup
Import the required Python libraries by running the next cell.
from pystac_client import Clientimport matplotlib.pyplot as pltimport matplotlibimport pandas as pdimport numpy as npimport hvplot.xarrayfrom hvplot import hvPlotimport xarray as xrimport rioxarray as rxrimport stackstacimport h5py import osos.environ['USE_PYGEOS'] ='0'import datetimeimport geopandas as gpdimport foliumimport folium.pluginsfrom folium.plugins import MousePositionimport cartopy.crs as ccrsimport cartopy.feature as cfimport cartopy.io.img_tiles as cimgtimport requestsimport surfaceAreaGridfrom geopy import geocoders# For reading COG to xarrayimport stackstac# For displaying image in a jupyter notebookfrom IPython.display import Image, display# For reading from S3 bucketimport boto3pd.options.plotting.backend ='holoviews'
---------------------------------------------------------------------------ModuleNotFoundError Traceback (most recent call last)
Cell In[15], line 23 21importcartopy.io.img_tilesascimgt 22importrequests---> 23importsurfaceAreaGrid 24fromgeopyimport geocoders
25# For reading COG to xarrayModuleNotFoundError: No module named 'surfaceAreaGrid'
# Provide STAC and RASTER API endpointsSTAC_API_URL ="http://earth.gov/ghgcenter/api/stac"RASTER_API_URL ="https://earth.gov/ghgcenter/api/raster"
# Fetching the collection from STAC collections using appropriate endpoint# The 'requests' library allows a HTTP request possible# Open catalog, print info and available collectionscatalog = Client.open(STAC_API_URL)# print catalog and collections titlesprint('>> Title: ',catalog.title)print('>> Collections:')for collection in catalog.get_collections():print(collection.id)
description"The Greenhouse gas And Air Pollutants Emissions System (GRA²PES) dataset at the GHG Center is an aggregated, regridded, monthly high-resolution (0.036 x 0.036°) data product with emissions of both greenhouse gases and air pollutants developed in a consistent framework. The dataset contains emissions over the contiguous United States covering major anthropogenic sectors, including energy, industrial fuel combustion and processes, commercial and residential combustion, oil and gas production, on-road and off-road transportation, etc. Carbon dioxide (CO₂) emissions are developed along with those of air pollutants including CO, NOₓ, SO₂, and PM2.5 with consistency in spatial and temporal distributions. Emissions by sectors are reported as column totals in units of metric tons per km² per month. Spatial-temporal surrogates are developed to distribute CO₂ emissions to grid cells to keep consistency between greenhouse gases and air quality species. The current version of GRA²PES is for 2021. Long-term emissions and more greenhouse gas species (e.g., methane) are under development and will be added in the future. Description of data processing: Derived from wrfchem_d01 files. Totaled in Z space; native 12-hour (00z and 12z) files averaged to get mean daily emissions; weighted average calculated using weekdy, sundy, satdy to produce average emissions rates for given month. Regridded from native LCC projection and 4000m resolution to EPSG 4326. The native dataset can be accessed from the NIST data center: https://doi.org/10.18434/mds2-3520"
Science topic: Compare urban and rural CO2 season cycles
Let’s compare an urban area to a rural area - for example, the Chicagoland area vs. central Illinois.
Read data from STAC into xarray Dataset
search = catalog.search( collections='gra2pes-ghg-monthgrid-v1', datetime=['2021-01-01T00:00:00Z','2021-12-31T00:00:00Z'])# Take a look at the items we foundfor item in search.item_collection():print(item)